﻿namespace QLPhongKham.UC
{
    using ConfigDatabase.Class;
    using DevExpress.Data;
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Base;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraTab;
    using QLPhongKham.Access;
    using QLPhongKham.Access.Duoc;
    using QLPhongKham.BaseClass.Duoc;
    using QLPhongKham.Report;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.IO;
    using System.Windows.Forms;

    public class ucd_dmduocpham : XtraUserControl
    {
        private ConnectDatabase _condata;
        private dtoDDMDuocPham _dto;
        private General _xuli;
        private SimpleButton btnboqua;
        private SimpleButton btnimport;
        private SimpleButton btnin;
        private SimpleButton btnketthuc;
        private SimpleButton btnluu;
        private SimpleButton btnmoi;
        private SimpleButton btnsua;
        private SimpleButton btnxoa;
        private LookUpEdit cbbloai;
        private LookUpEdit cbbnhasx;
        private LookUpEdit cbbnhom;
        private IContainer components;
        private GridControl gridds;
        private GridColumn gridds_dvt;
        private GridColumn gridds_ghichu;
        private GridColumn gridds_hamluong;
        private GridColumn gridds_hoatchat;
        private GridColumn gridds_id;
        private GridColumn gridds_idloai;
        private GridColumn gridds_idnhasx;
        private GridColumn gridds_idnhom;
        private GridColumn gridds_ma;
        private GridColumn gridds_stt;
        private GridColumn gridds_ten;
        private GridColumn gridds_tenloai;
        private GridColumn gridds_tennhom;
        private GridView gridView1;
        private Label label1;
        private Label label10;
        private Label label11;
        private Label label2;
        private Label label3;
        private Label label4;
        private Label label5;
        private Label label6;
        private Label label7;
        private Label label8;
        private Label label9;
        private RepositoryItemTextEdit repositoryItemTextEdit1;
        private TextEdit txtdvt;
        private TextEdit txtghichu;
        private TextEdit txthamluong;
        private TextEdit txthoatchat;
        private TextEdit txtma;
        private TextEdit txtstt;
        private TextEdit txtten;

        public ucd_dmduocpham()
        {
            this.components = null;
            this.InitializeComponent();
            this._condata = new ConnectDatabase();
        }

        public ucd_dmduocpham(ConnectDatabase condata)
        {
            this.components = null;
            this.InitializeComponent();
            this._condata = condata;
        }

        private void btnboqua_Click(object sender, EventArgs e)
        {
            this.f_Control_enable(false);
        }

        private void btnimport_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog {
                Title = "Chọn file excel dữ liệu",
                Filter = "(Excel 2003).xls|*.xls|(Execel 2007).xlsx|*.xlsx",
                FilterIndex = 0,
                Multiselect = false
            };
            dialog.ShowDialog();
            if (dialog.FileName != "")
            {
                string fileName = dialog.FileName;
                DataTable table = this._xuli.f_getdata_fromfileExcel(fileName, "Sheet");
                if (table.Columns.Count != 6)
                {
                    MessageBox.Show("Định dạng file excel kh\x00f4ng đ\x00fang.\nVui l\x00f2ng kiểm tra lại:1.Số thứ tự\n2.M\x00e3 số\n3.T\x00ean viện ph\x00ed.\n4.Đơn vị t\x00ednh.\n5.H\x00e0m lượng.\n6.Hoạt chất.", "Th\x00f4ng b\x00e1o");
                }
                else if ((table.Rows.Count <= 0) || (MessageBox.Show("Bạn c\x00f3 muốn th\x00eam dữ liệu từ file excel v\x00e0o dữ liệu hiện tại kh\x00f4ng?\nChọn Yes để chấp nhận.\nChọn No để bỏ qua thao t\x00e1c.", "Th\x00f4ng b\x00e1o", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.No))
                {
                    dtoDDMDuocPham pham = new dtoDDMDuocPham(this._xuli.pConFigData);
                    if ((MessageBox.Show("Bạn c\x00f3 muốn hủy dữ liệu hiện tại kh\x00f4ng?\nChọn Yes để chấp nhận.\nChọn No để bỏ qua thao t\x00e1c.", "Th\x00f4ng b\x00e1o", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) && !pham.DeleteALL())
                    {
                        MessageBox.Show("Hủy dữ liệu kh\x00f4ng th\x00e0nh c\x00f4ng.\nThao t\x00e1c bị hủy bởi r\x00e0ng buộc dữ liệu.", "Th\x00f4ng b\x00e1o");
                    }
                    else
                    {
                        string str2 = "";
                        for (int i = 0; i < table.Rows.Count; i++)
                        {
                            if (table.Rows[i][table.Columns.Count - 1].ToString() != "")
                            {
                                pham = new dtoDDMDuocPham(this._xuli.pConFigData) {
                                    pID = pham.GetIDInsert()
                                };
                                try
                                {
                                    pham.pSTT = int.Parse(table.Rows[i][0].ToString());
                                }
                                catch
                                {
                                }
                                pham.pMA = table.Rows[i][1].ToString();
                                pham.pTEN = table.Rows[i][2].ToString();
                                pham.pDVT = table.Rows[i][3].ToString();
                                pham.pHAMLUONG = table.Rows[i][4].ToString();
                                pham.pTENHOATCHAT = table.Rows[i][5].ToString();
                                if (!pham.Insert())
                                {
                                    object obj2 = str2;
                                    str2 = string.Concat(new object[] { obj2, "\n", pham.pSTT, "-", pham.pTEN, "-", pham.pDVT, "-", pham.pMA, ";" });
                                }
                            }
                        }
                        if (str2 != "")
                        {
                            MessageBox.Show("C\x00e1c dữ liệu sau bị lỗi:" + str2, "Th\x00f4ng b\x00e1o");
                        }
                        this.f_Loaddata_dmvp();
                    }
                }
            }
        }

        private void btnin_Click(object sender, EventArgs e)
        {
            DataTable dataSource = (DataTable) this.gridds.DataSource;
            dataSource.AcceptChanges();
            DataSet data = new DataSet();
            data.Tables.Add(dataSource.Copy());
            try
            {
                data.WriteXml(Directory.GetCurrentDirectory() + @"\dataxml\d_dmduocpham.xml", XmlWriteMode.WriteSchema);
            }
            catch
            {
            }
            new XtraReport1().f_load(data, "repx_d_dmduocpham.repx");
        }

        private void btnketthuc_Click(object sender, EventArgs e)
        {
            try
            {
                XtraTabPage parent = (XtraTabPage) base.Parent;
                XtraTabControl control = (XtraTabControl) parent.Parent;
                control.TabPages.Remove(parent);
            }
            catch
            {
                try
                {
                    UserControl control2 = (UserControl) base.Parent;
                    control2.Controls.Remove(this);
                }
                catch
                {
                }
            }
        }

        private void btnluu_Click(object sender, EventArgs e)
        {
            this._dto = new dtoDDMDuocPham(this._condata);
            this._dto.pDVT = this.txtdvt.Text;
            this._dto.pGHICHU = this.txtghichu.Text;
            this._dto.pMA = this.txtma.Text;
            this._dto.pTEN = this.txtten.Text;
            try
            {
                this._dto.pSTT = int.Parse(this.txtstt.Text);
            }
            catch
            {
            }
            this._dto.pHAMLUONG = this.txthamluong.Text;
            this._dto.pTENHOATCHAT = this.txthoatchat.Text;
            this._dto.pIDNHOM = int.Parse(this.cbbnhom.EditValue.ToString());
            this._dto.pIDLOAI = int.Parse(this.cbbloai.EditValue.ToString());
            this._dto.pIDNHASX = int.Parse(this.cbbnhasx.EditValue.ToString());
            this._dto.pID = int.Parse(this.txtma.Tag.ToString());
            if (this.txtma.Tag.ToString() == "0")
            {
                this._dto.pID = this._dto.GetIDInsert();
                if (!this._dto.Insert())
                {
                    MessageBox.Show("Kh\x00f4ng lưu được th\x00f4ng tin dược phẩm", "Th\x00f4ng b\x00e1o");
                    return;
                }
            }
            else if (!this._dto.Update())
            {
                MessageBox.Show("Kh\x00f4ng lưu được th\x00f4ng tin dược phẩm", "Th\x00f4ng b\x00e1o");
                return;
            }
            this.f_Loaddata_dmvp();
            this.f_Control_enable(false);
        }

        private void btnmoi_Click(object sender, EventArgs e)
        {
            this.f_Loadcontrol_dmvp(0L, "", "", "", "", "", "", "", 0, 0, 0);
            this.f_Control_enable(true);
            this.f_Loaddata_dmloaidp();
            this.f_Loaddata_dmnhomdp();
            this.f_Loaddata_dmnhasx();
            base.ActiveControl = this.txtma;
        }

        private void btnsua_Click(object sender, EventArgs e)
        {
            this.f_Control_enable(true);
            this.f_Loaddata_dmloaidp();
            this.f_Loaddata_dmnhomdp();
            this.f_Loaddata_dmnhasx();
            try
            {
                int indexrow = this.gridView1.GetSelectedRows()[0];
                this.f_loadinfo_dmsanpham(indexrow);
            }
            catch
            {
            }
            this.txtten.Focus();
        }

        private void btnxoa_Click(object sender, EventArgs e)
        {
            if ((this.txtma.Tag.ToString() != "0") && (MessageBox.Show("Bạn c\x00f3 chắc chắn muốn hủy th\x00f4ng tin:\n" + this.txtma.Text + " - " + this.txtten.Text + " ?", "Th\x00f4ng b\x00e1o", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) != DialogResult.No))
            {
                try
                {
                    this._dto = new dtoDDMDuocPham(this._condata);
                    this._dto.pID = int.Parse(this.txtma.Tag.ToString());
                    if (!this._dto.Delete())
                    {
                        MessageBox.Show("Hủy kh\x00f4ng th\x00e0nh c\x00f4ng.Vui l\x00f2ng kiểm tra lại.", "Th\x00f4ng b\x00e1o");
                    }
                    else
                    {
                        MessageBox.Show("Đ\x00e3 hủy th\x00e0nh c\x00f4ng.", "Th\x00f4ng b\x00e1o");
                        this.f_Loaddata_dmvp();
                    }
                }
                catch
                {
                }
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void f_Control_enable(bool chophep)
        {
            this.btnluu.Enabled = this.btnboqua.Enabled = chophep;
            this.btnmoi.Enabled = this.btnxoa.Enabled = this.btnsua.Enabled = this.btnketthuc.Enabled = !chophep;
            this.gridds.Enabled = !chophep;
        }

        private void f_Loadcontrol_dmvp(long id, string ma, string ten, string dvt, string size, string ghichu, string hamluong, string hoatchat, int idloai, int idnhom, int idnhasx)
        {
            this.txtma.Text = ma;
            this.txtma.Tag = id.ToString();
            this.txtten.Text = ten;
            this.txtdvt.Text = dvt;
            this.txtstt.Text = size;
            this.txtghichu.Text = ghichu;
            this.txthamluong.Text = hamluong;
            this.txthoatchat.Text = hoatchat;
            this.cbbloai.EditValue = Convert.ToDecimal(idloai);
            this.cbbnhom.EditValue = Convert.ToDecimal(idnhom);
            this.cbbnhasx.EditValue = Convert.ToDecimal(idnhasx);
        }

        private void f_Loaddata_dmloaidp()
        {
            try
            {
                this.cbbloai.Properties.DataSource = new dtoDDMLoaiDuocPham(this._xuli.pConFigData).LoadAll();
                this.cbbloai.Properties.DisplayMember = "ten";
                this.cbbloai.Properties.ValueMember = "id";
                this.cbbloai.ItemIndex = 0;
            }
            catch
            {
            }
        }

        private void f_Loaddata_dmnhasx()
        {
            try
            {
                this.cbbnhasx.Properties.DataSource = new dtoDDMNhaSanXuat(this._xuli.pConFigData).LoadAll();
                this.cbbnhasx.Properties.DisplayMember = "ten";
                this.cbbnhasx.Properties.ValueMember = "id";
                this.cbbnhasx.ItemIndex = 0;
            }
            catch
            {
            }
        }

        private void f_Loaddata_dmnhomdp()
        {
            try
            {
                this.cbbnhom.Properties.DataSource = new dtoDDMNhomDuocPham(this._xuli.pConFigData).LoadAll();
                this.cbbnhom.Properties.DisplayMember = "ten";
                this.cbbnhom.Properties.ValueMember = "id";
                this.cbbnhom.ItemIndex = 0;
            }
            catch
            {
            }
        }

        private void f_Loaddata_dmvp()
        {
            try
            {
                this.gridds.DataSource = new DDuocPham(this._condata).f_loaddata_dmduocpham();
            }
            catch
            {
            }
        }

        private void f_loadinfo_dmsanpham(int indexrow)
        {
            try
            {
                this.f_Loadcontrol_dmvp(long.Parse(this.gridView1.GetRowCellValue(indexrow, this.gridds_id).ToString()), this.gridView1.GetRowCellValue(indexrow, this.gridds_ma).ToString(), this.gridView1.GetRowCellValue(indexrow, this.gridds_ten).ToString(), this.gridView1.GetRowCellValue(indexrow, this.gridds_dvt).ToString(), this.gridView1.GetRowCellValue(indexrow, this.gridds_stt).ToString(), this.gridView1.GetRowCellValue(indexrow, this.gridds_ghichu).ToString(), this.gridView1.GetRowCellValue(indexrow, this.gridds_hamluong).ToString(), this.gridView1.GetRowCellValue(indexrow, this.gridds_hoatchat).ToString(), int.Parse(this.gridView1.GetRowCellValue(indexrow, this.gridds_idloai).ToString()), int.Parse(this.gridView1.GetRowCellValue(indexrow, this.gridds_idnhom).ToString()), int.Parse(this.gridView1.GetRowCellValue(indexrow, this.gridds_idnhasx).ToString()));
            }
            catch
            {
            }
        }

        private void gridView1_CustomSummaryCalculate(object sender, CustomSummaryEventArgs e)
        {
        }

        private void gridView1_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
        {
            int indexrow = 0;
            try
            {
                if (this.gridView1.IsFocusedView)
                {
                    indexrow = this.gridView1.GetSelectedRows()[0];
                    this.f_loadinfo_dmsanpham(indexrow);
                }
            }
            catch
            {
            }
        }

        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(ucd_dmduocpham));
            this.label1 = new Label();
            this.label2 = new Label();
            this.txtma = new TextEdit();
            this.label3 = new Label();
            this.txtten = new TextEdit();
            this.label4 = new Label();
            this.txtdvt = new TextEdit();
            this.label5 = new Label();
            this.txtstt = new TextEdit();
            this.label7 = new Label();
            this.txtghichu = new TextEdit();
            this.btnmoi = new SimpleButton();
            this.btnluu = new SimpleButton();
            this.btnsua = new SimpleButton();
            this.btnxoa = new SimpleButton();
            this.btnketthuc = new SimpleButton();
            this.gridView1 = new GridView();
            this.gridds_ma = new GridColumn();
            this.repositoryItemTextEdit1 = new RepositoryItemTextEdit();
            this.gridds_ten = new GridColumn();
            this.gridds_dvt = new GridColumn();
            this.gridds_id = new GridColumn();
            this.gridds_stt = new GridColumn();
            this.gridds_ghichu = new GridColumn();
            this.gridds_hamluong = new GridColumn();
            this.gridds_hoatchat = new GridColumn();
            this.gridds_idnhom = new GridColumn();
            this.gridds_idloai = new GridColumn();
            this.gridds_tenloai = new GridColumn();
            this.gridds_tennhom = new GridColumn();
            this.gridds_idnhasx = new GridColumn();
            this.gridds = new GridControl();
            this.btnboqua = new SimpleButton();
            this.btnin = new SimpleButton();
            this.btnimport = new SimpleButton();
            this.label6 = new Label();
            this.txthamluong = new TextEdit();
            this.label8 = new Label();
            this.txthoatchat = new TextEdit();
            this.label9 = new Label();
            this.cbbnhom = new LookUpEdit();
            this.label10 = new Label();
            this.cbbloai = new LookUpEdit();
            this.label11 = new Label();
            this.cbbnhasx = new LookUpEdit();
            this.txtma.Properties.BeginInit();
            this.txtten.Properties.BeginInit();
            this.txtdvt.Properties.BeginInit();
            this.txtstt.Properties.BeginInit();
            this.txtghichu.Properties.BeginInit();
            this.gridView1.BeginInit();
            this.repositoryItemTextEdit1.BeginInit();
            this.gridds.BeginInit();
            this.txthamluong.Properties.BeginInit();
            this.txthoatchat.Properties.BeginInit();
            this.cbbnhom.Properties.BeginInit();
            this.cbbloai.Properties.BeginInit();
            this.cbbnhasx.Properties.BeginInit();
            base.SuspendLayout();
            this.label1.BackColor = Color.ForestGreen;
            this.label1.Dock = DockStyle.Top;
            this.label1.Font = new Font("Tahoma", 16f);
            this.label1.ForeColor = Color.Yellow;
            this.label1.Location = new Point(0, 0);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x392, 0x30);
            this.label1.TabIndex = 1;
            this.label1.Text = "DANH MỤC DƯỢC PHẨM";
            this.label1.TextAlign = ContentAlignment.MiddleCenter;
            this.label2.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.label2.Font = new Font("Tahoma", 10f);
            this.label2.Location = new Point(5, 0x132);
            this.label2.Name = "label2";
            this.label2.Size = new Size(0x4d, 0x13);
            this.label2.TabIndex = 2;
            this.label2.Text = "M\x00e3 số:";
            this.label2.TextAlign = ContentAlignment.TopRight;
            this.txtma.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.txtma.Location = new Point(0x51, 0x131);
            this.txtma.Name = "txtma";
            this.txtma.Properties.CharacterCasing = CharacterCasing.Upper;
            this.txtma.Size = new Size(90, 20);
            this.txtma.TabIndex = 0;
            this.txtma.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.label3.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.label3.Font = new Font("Tahoma", 10f);
            this.label3.Location = new Point(170, 0x132);
            this.label3.Name = "label3";
            this.label3.Size = new Size(0x54, 0x13);
            this.label3.TabIndex = 2;
            this.label3.Text = "T\x00ean:";
            this.label3.TextAlign = ContentAlignment.TopRight;
            this.txtten.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom;
            this.txtten.Location = new Point(0xfe, 0x131);
            this.txtten.Name = "txtten";
            this.txtten.Size = new Size(0x22f, 20);
            this.txtten.TabIndex = 1;
            this.txtten.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.txtten.Validated += new EventHandler(this.txtten_Validated);
            this.label4.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.label4.Font = new Font("Tahoma", 10f);
            this.label4.Location = new Point(0x324, 0x132);
            this.label4.Name = "label4";
            this.label4.Size = new Size(0x36, 0x13);
            this.label4.TabIndex = 2;
            this.label4.Text = "ĐVT:";
            this.label4.TextAlign = ContentAlignment.TopRight;
            this.txtdvt.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.txtdvt.Location = new Point(0x35b, 0x131);
            this.txtdvt.Name = "txtdvt";
            this.txtdvt.Size = new Size(0x31, 20);
            this.txtdvt.TabIndex = 2;
            this.txtdvt.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.label5.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.label5.Font = new Font("Tahoma", 10f);
            this.label5.Location = new Point(790, 0x14c);
            this.label5.Name = "label5";
            this.label5.Size = new Size(70, 0x13);
            this.label5.TabIndex = 2;
            this.label5.Text = "STT:";
            this.label5.TextAlign = ContentAlignment.TopRight;
            this.txtstt.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.txtstt.Location = new Point(0x35b, 0x14b);
            this.txtstt.Name = "txtstt";
            this.txtstt.Size = new Size(0x31, 20);
            this.txtstt.TabIndex = 6;
            this.txtstt.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.label7.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.label7.Font = new Font("Tahoma", 10f);
            this.label7.Location = new Point(0x1c8, 0x14c);
            this.label7.Name = "label7";
            this.label7.Size = new Size(0x4c, 0x13);
            this.label7.TabIndex = 2;
            this.label7.Text = "Ghi ch\x00fa:";
            this.label7.TextAlign = ContentAlignment.TopRight;
            this.txtghichu.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom;
            this.txtghichu.Location = new Point(0x211, 0x14b);
            this.txtghichu.Name = "txtghichu";
            this.txtghichu.Size = new Size(0x11c, 20);
            this.txtghichu.TabIndex = 5;
            this.txtghichu.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.btnmoi.Anchor = AnchorStyles.Bottom;
            this.btnmoi.Appearance.Options.UseTextOptions = true;
            this.btnmoi.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
            this.btnmoi.Image = Properties.Resources.imgnew;// (Image)manager.GetObject("btnmoi.Image");
            this.btnmoi.Location = new Point(0x62, 0x185);
            this.btnmoi.Name = "btnmoi";
            this.btnmoi.Size = new Size(0x4b, 0x17);
            this.btnmoi.TabIndex = 8;
            this.btnmoi.Text = " &Mới [F2]";
            this.btnmoi.Click += new EventHandler(this.btnmoi_Click);
            this.btnluu.Anchor = AnchorStyles.Bottom;
            this.btnluu.Appearance.Options.UseTextOptions = true;
            this.btnluu.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
            this.btnluu.Image = Properties.Resources.imgsave;// (Image)manager.GetObject("btnluu.Image");
            this.btnluu.Location = new Point(0xb0, 0x185);
            this.btnluu.Name = "btnluu";
            this.btnluu.Size = new Size(0x4b, 0x17);
            this.btnluu.TabIndex = 7;
            this.btnluu.Text = " &Lưu [F5]";
            this.btnluu.Click += new EventHandler(this.btnluu_Click);
            this.btnsua.Anchor = AnchorStyles.Bottom;
            this.btnsua.Appearance.Options.UseTextOptions = true;
            this.btnsua.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
            this.btnsua.Image = Properties.Resources.imgedit;// (Image)manager.GetObject("btnsua.Image");
            this.btnsua.Location = new Point(0xfe, 0x185);
            this.btnsua.Name = "btnsua";
            this.btnsua.Size = new Size(0x4b, 0x17);
            this.btnsua.TabIndex = 9;
            this.btnsua.Text = " &Sửa [F3]";
            this.btnsua.Click += new EventHandler(this.btnsua_Click);
            this.btnxoa.Anchor = AnchorStyles.Bottom;
            this.btnxoa.Image = Properties.Resources.imgdelete;// (Image)manager.GetObject("btnxoa.Image");
            this.btnxoa.Location = new Point(0x1a5, 0x185);
            this.btnxoa.Name = "btnxoa";
            this.btnxoa.Size = new Size(0x4b, 0x17);
            this.btnxoa.TabIndex = 11;
            this.btnxoa.Text = " &Hủy [F7]";
            this.btnxoa.Click += new EventHandler(this.btnxoa_Click);
            this.btnketthuc.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btnketthuc.Appearance.Options.UseTextOptions = true;
            this.btnketthuc.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
            this.btnketthuc.Image = Properties.Resources.imgclose;// (Image)manager.GetObject("btnketthuc.Image");
            this.btnketthuc.Location = new Point(0x327, 0x188);
            this.btnketthuc.Name = "btnketthuc";
            this.btnketthuc.Size = new Size(0x65, 0x17);
            this.btnketthuc.TabIndex = 14;
            this.btnketthuc.Text = " &Kết th\x00fac [F12]";
            this.btnketthuc.Click += new EventHandler(this.btnketthuc_Click);
            this.gridView1.Appearance.ColumnFilterButton.BackColor = Color.FromArgb(0xca, 0xdd, 0xd0);
            this.gridView1.Appearance.ColumnFilterButton.BorderColor = Color.FromArgb(0xca, 0xdd, 0xd0);
            this.gridView1.Appearance.ColumnFilterButton.ForeColor = Color.Black;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseBackColor = true;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseForeColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.BackColor = Color.FromArgb(0xd3, 0xe2, 0xd8);
            this.gridView1.Appearance.ColumnFilterButtonActive.BorderColor = Color.FromArgb(0xd3, 0xe2, 0xd8);
            this.gridView1.Appearance.ColumnFilterButtonActive.ForeColor = Color.Black;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseBackColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseBorderColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseForeColor = true;
            this.gridView1.Appearance.Empty.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.Empty.BackColor2 = Color.White;
            this.gridView1.Appearance.Empty.Options.UseBackColor = true;
            this.gridView1.Appearance.EvenRow.BackColor = Color.FromArgb(0xdd, 0xe3, 0xf5);
            this.gridView1.Appearance.EvenRow.BorderColor = Color.FromArgb(0xdd, 0xe3, 0xf5);
            this.gridView1.Appearance.EvenRow.ForeColor = Color.Black;
            this.gridView1.Appearance.EvenRow.Options.UseBackColor = true;
            this.gridView1.Appearance.EvenRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.EvenRow.Options.UseForeColor = true;
            this.gridView1.Appearance.FilterCloseButton.BackColor = Color.FromArgb(0xca, 0xdd, 0xd0);
            this.gridView1.Appearance.FilterCloseButton.BorderColor = Color.FromArgb(0xca, 0xdd, 0xd0);
            this.gridView1.Appearance.FilterCloseButton.ForeColor = Color.Black;
            this.gridView1.Appearance.FilterCloseButton.Options.UseBackColor = true;
            this.gridView1.Appearance.FilterCloseButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.FilterCloseButton.Options.UseForeColor = true;
            this.gridView1.Appearance.FilterPanel.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.FilterPanel.BackColor2 = Color.White;
            this.gridView1.Appearance.FilterPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.FilterPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.FilterPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.FixedLine.BackColor = Color.FromArgb(0x75, 0x88, 0x7a);
            this.gridView1.Appearance.FixedLine.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedCell.BackColor = Color.White;
            this.gridView1.Appearance.FocusedCell.ForeColor = Color.Black;
            this.gridView1.Appearance.FocusedCell.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedCell.Options.UseForeColor = true;
            this.gridView1.Appearance.FocusedRow.BackColor = Color.FromArgb(0x81, 0xab, 0xb1);
            this.gridView1.Appearance.FocusedRow.ForeColor = Color.White;
            this.gridView1.Appearance.FocusedRow.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedRow.Options.UseForeColor = true;
            this.gridView1.Appearance.FooterPanel.BackColor = Color.FromArgb(0xca, 0xdd, 0xd0);
            this.gridView1.Appearance.FooterPanel.BorderColor = Color.FromArgb(0xca, 0xdd, 0xd0);
            this.gridView1.Appearance.FooterPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.FooterPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.FooterPanel.Options.UseBorderColor = true;
            this.gridView1.Appearance.FooterPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupButton.BackColor = Color.FromArgb(0xb2, 0xd1, 0xbc);
            this.gridView1.Appearance.GroupButton.BorderColor = Color.FromArgb(0xb2, 0xd1, 0xbc);
            this.gridView1.Appearance.GroupButton.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupFooter.BackColor = Color.FromArgb(0xd7, 0xea, 0xdd);
            this.gridView1.Appearance.GroupFooter.BorderColor = Color.FromArgb(0xd7, 0xea, 0xdd);
            this.gridView1.Appearance.GroupFooter.ForeColor = Color.Black;
            this.gridView1.Appearance.GroupFooter.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupFooter.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupFooter.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupPanel.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.GroupPanel.BackColor2 = Color.White;
            this.gridView1.Appearance.GroupPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.GroupPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupRow.BackColor = Color.FromArgb(0xd7, 0xea, 0xdd);
            this.gridView1.Appearance.GroupRow.BorderColor = Color.FromArgb(0xd7, 0xea, 0xdd);
            this.gridView1.Appearance.GroupRow.ForeColor = Color.Black;
            this.gridView1.Appearance.GroupRow.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupRow.Options.UseForeColor = true;
            this.gridView1.Appearance.HeaderPanel.BackColor = Color.FromArgb(0xd3, 0xe2, 0xd8);
            this.gridView1.Appearance.HeaderPanel.BorderColor = Color.FromArgb(0xd3, 0xe2, 0xd8);
            this.gridView1.Appearance.HeaderPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.HeaderPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.HeaderPanel.Options.UseBorderColor = true;
            this.gridView1.Appearance.HeaderPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.HideSelectionRow.BackColor = Color.FromArgb(0xba, 0xd3, 0xd7);
            this.gridView1.Appearance.HideSelectionRow.ForeColor = Color.FromArgb(0x68, 130, 0x86);
            this.gridView1.Appearance.HideSelectionRow.Options.UseBackColor = true;
            this.gridView1.Appearance.HideSelectionRow.Options.UseForeColor = true;
            this.gridView1.Appearance.HorzLine.BackColor = Color.FromArgb(0xac, 0xc5, 180);
            this.gridView1.Appearance.HorzLine.BorderColor = Color.FromArgb(0x75, 0x88, 0x7a);
            this.gridView1.Appearance.HorzLine.Options.UseBackColor = true;
            this.gridView1.Appearance.HorzLine.Options.UseBorderColor = true;
            this.gridView1.Appearance.OddRow.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.OddRow.BorderColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.OddRow.ForeColor = Color.Black;
            this.gridView1.Appearance.OddRow.Options.UseBackColor = true;
            this.gridView1.Appearance.OddRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.OddRow.Options.UseForeColor = true;
            this.gridView1.Appearance.Preview.BackColor = Color.FromArgb(250, 250, 240);
            this.gridView1.Appearance.Preview.Font = new Font("Verdana", 7.5f);
            this.gridView1.Appearance.Preview.ForeColor = Color.FromArgb(0x68, 130, 0x86);
            this.gridView1.Appearance.Preview.Options.UseBackColor = true;
            this.gridView1.Appearance.Preview.Options.UseFont = true;
            this.gridView1.Appearance.Preview.Options.UseForeColor = true;
            this.gridView1.Appearance.Row.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.Row.ForeColor = Color.Black;
            this.gridView1.Appearance.Row.Options.UseBackColor = true;
            this.gridView1.Appearance.Row.Options.UseForeColor = true;
            this.gridView1.Appearance.RowSeparator.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.RowSeparator.BackColor2 = Color.White;
            this.gridView1.Appearance.RowSeparator.Options.UseBackColor = true;
            this.gridView1.Appearance.SelectedRow.BackColor = Color.FromArgb(0x9f, 0xc9, 0xcf);
            this.gridView1.Appearance.SelectedRow.ForeColor = Color.Black;
            this.gridView1.Appearance.SelectedRow.Options.UseBackColor = true;
            this.gridView1.Appearance.SelectedRow.Options.UseForeColor = true;
            this.gridView1.Appearance.TopNewRow.BackColor = Color.White;
            this.gridView1.Appearance.TopNewRow.Options.UseBackColor = true;
            this.gridView1.Appearance.VertLine.BackColor = Color.FromArgb(0xac, 0xc5, 180);
            this.gridView1.Appearance.VertLine.BorderColor = Color.FromArgb(0x75, 0x88, 0x7a);
            this.gridView1.Appearance.VertLine.Options.UseBackColor = true;
            this.gridView1.Appearance.VertLine.Options.UseBorderColor = true;
            this.gridView1.Columns.AddRange(new GridColumn[] { this.gridds_ma, this.gridds_ten, this.gridds_dvt, this.gridds_id, this.gridds_stt, this.gridds_ghichu, this.gridds_hamluong, this.gridds_hoatchat, this.gridds_idnhom, this.gridds_idloai, this.gridds_tenloai, this.gridds_tennhom, this.gridds_idnhasx });
            this.gridView1.GridControl = this.gridds;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsView.AutoCalcPreviewLineCount = true;
            this.gridView1.OptionsView.EnableAppearanceEvenRow = true;
            this.gridView1.OptionsView.EnableAppearanceOddRow = true;
            this.gridView1.OptionsView.ShowAutoFilterRow = true;
            this.gridView1.OptionsView.ShowFooter = true;
            this.gridView1.CustomSummaryCalculate += new CustomSummaryEventHandler(this.gridView1_CustomSummaryCalculate);
            this.gridView1.FocusedRowChanged += new FocusedRowChangedEventHandler(this.gridView1_FocusedRowChanged);
            this.gridds_ma.Caption = "M\x00e3 số";
            this.gridds_ma.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_ma.FieldName = "ma";
            this.gridds_ma.Name = "gridds_ma";
            this.gridds_ma.OptionsColumn.AllowEdit = false;
            this.gridds_ma.Summary.AddRange(new GridSummaryItem[] { new GridColumnSummaryItem(SummaryItemType.Count, "ma", "Số lượng={0:n0}") });
            this.gridds_ma.Visible = true;
            this.gridds_ma.VisibleIndex = 1;
            this.gridds_ma.Width = 0x4f;
            this.repositoryItemTextEdit1.AutoHeight = false;
            this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
            this.repositoryItemTextEdit1.ReadOnly = true;
            this.gridds_ten.Caption = "T\x00ean dược phẩm";
            this.gridds_ten.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_ten.FieldName = "ten";
            this.gridds_ten.Name = "gridds_ten";
            this.gridds_ten.OptionsColumn.AllowEdit = false;
            this.gridds_ten.OptionsColumn.FixedWidth = true;
            this.gridds_ten.Visible = true;
            this.gridds_ten.VisibleIndex = 2;
            this.gridds_ten.Width = 0x10b;
            this.gridds_dvt.Caption = "ĐVT";
            this.gridds_dvt.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_dvt.FieldName = "dvt";
            this.gridds_dvt.Name = "gridds_dvt";
            this.gridds_dvt.OptionsColumn.AllowEdit = false;
            this.gridds_dvt.Visible = true;
            this.gridds_dvt.VisibleIndex = 3;
            this.gridds_dvt.Width = 0x21;
            this.gridds_id.Caption = "id";
            this.gridds_id.FieldName = "id";
            this.gridds_id.Name = "gridds_id";
            this.gridds_stt.Caption = "STT";
            this.gridds_stt.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_stt.FieldName = "stt";
            this.gridds_stt.Name = "gridds_stt";
            this.gridds_stt.OptionsColumn.AllowEdit = false;
            this.gridds_stt.Visible = true;
            this.gridds_stt.VisibleIndex = 0;
            this.gridds_stt.Width = 0x21;
            this.gridds_ghichu.Caption = "Ghi ch\x00fa";
            this.gridds_ghichu.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_ghichu.FieldName = "ghichu";
            this.gridds_ghichu.Name = "gridds_ghichu";
            this.gridds_ghichu.OptionsColumn.AllowEdit = false;
            this.gridds_ghichu.Visible = true;
            this.gridds_ghichu.VisibleIndex = 8;
            this.gridds_ghichu.Width = 0x51;
            this.gridds_hamluong.Caption = "H\x00e0m lượng";
            this.gridds_hamluong.FieldName = "hamluong";
            this.gridds_hamluong.Name = "gridds_hamluong";
            this.gridds_hamluong.OptionsColumn.AllowEdit = false;
            this.gridds_hamluong.OptionsColumn.ReadOnly = true;
            this.gridds_hamluong.Visible = true;
            this.gridds_hamluong.VisibleIndex = 4;
            this.gridds_hamluong.Width = 0x3a;
            this.gridds_hoatchat.Caption = "Hoạt chất";
            this.gridds_hoatchat.FieldName = "tenhoatchat";
            this.gridds_hoatchat.Name = "gridds_hoatchat";
            this.gridds_hoatchat.OptionsColumn.AllowEdit = false;
            this.gridds_hoatchat.OptionsColumn.ReadOnly = true;
            this.gridds_hoatchat.Visible = true;
            this.gridds_hoatchat.VisibleIndex = 5;
            this.gridds_hoatchat.Width = 0x52;
            this.gridds_idnhom.Caption = "idnhom";
            this.gridds_idnhom.FieldName = "idnhom";
            this.gridds_idnhom.Name = "gridds_idnhom";
            this.gridds_idloai.Caption = "idloai";
            this.gridds_idloai.FieldName = "idloai";
            this.gridds_idloai.Name = "gridds_idloai";
            this.gridds_tenloai.Caption = "Loại";
            this.gridds_tenloai.FieldName = "tenloai";
            this.gridds_tenloai.Name = "gridds_tenloai";
            this.gridds_tenloai.OptionsColumn.ReadOnly = true;
            this.gridds_tenloai.Visible = true;
            this.gridds_tenloai.VisibleIndex = 6;
            this.gridds_tenloai.Width = 0x79;
            this.gridds_tennhom.Caption = "Nh\x00f3m";
            this.gridds_tennhom.FieldName = "tennhom";
            this.gridds_tennhom.Name = "gridds_tennhom";
            this.gridds_tennhom.OptionsColumn.ReadOnly = true;
            this.gridds_tennhom.Visible = true;
            this.gridds_tennhom.VisibleIndex = 7;
            this.gridds_tennhom.Width = 0x8e;
            this.gridds_idnhasx.Caption = "idnhasx";
            this.gridds_idnhasx.FieldName = "idnhasx";
            this.gridds_idnhasx.Name = "gridds_idnhasx";
            this.gridds.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.gridds.Location = new Point(0, 0x33);
            this.gridds.MainView = this.gridView1;
            this.gridds.Name = "gridds";
            this.gridds.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemTextEdit1 });
            this.gridds.Size = new Size(0x392, 0xf8);
            this.gridds.TabIndex = 12;
            this.gridds.ViewCollection.AddRange(new BaseView[] { this.gridView1 });
            this.gridds.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.btnboqua.Anchor = AnchorStyles.Bottom;
            this.btnboqua.Image = Properties.Resources.imgundo;// (Image)manager.GetObject("btnboqua.Image");
            this.btnboqua.Location = new Point(0x14c, 0x185);
            this.btnboqua.Name = "btnboqua";
            this.btnboqua.Size = new Size(0x57, 0x17);
            this.btnboqua.TabIndex = 10;
            this.btnboqua.Text = " &Bỏ qua [F4]";
            this.btnboqua.Click += new EventHandler(this.btnboqua_Click);
            this.btnin.Anchor = AnchorStyles.Bottom;
            this.btnin.Image = Properties.Resources.imgprint;// (Image)manager.GetObject("btnin.Image");
            this.btnin.Location = new Point(0x1f3, 0x185);
            this.btnin.Name = "btnin";
            this.btnin.Size = new Size(0x30, 0x17);
            this.btnin.TabIndex = 12;
            this.btnin.Text = " &In";
            this.btnin.Click += new EventHandler(this.btnin_Click);
            this.btnimport.Anchor = AnchorStyles.Bottom;
            this.btnimport.Image = Properties.Resources.imgimportexcel;// (Image)manager.GetObject("btnimport.Image");
            this.btnimport.Location = new Point(0x225, 0x185);
            this.btnimport.Name = "btnimport";
            this.btnimport.Size = new Size(0x4b, 0x17);
            this.btnimport.TabIndex = 13;
            this.btnimport.Text = " &Chọn file";
            this.btnimport.Click += new EventHandler(this.btnimport_Click);
            this.label6.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.label6.Font = new Font("Tahoma", 10f);
            this.label6.Location = new Point(0, 0x14c);
            this.label6.Name = "label6";
            this.label6.Size = new Size(0x52, 0x13);
            this.label6.TabIndex = 2;
            this.label6.Text = "H\x00e0m lượng:";
            this.label6.TextAlign = ContentAlignment.TopRight;
            this.txthamluong.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.txthamluong.Location = new Point(0x51, 0x14b);
            this.txthamluong.Name = "txthamluong";
            this.txthamluong.Size = new Size(90, 20);
            this.txthamluong.TabIndex = 3;
            this.txthamluong.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.label8.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.label8.Font = new Font("Tahoma", 10f);
            this.label8.Location = new Point(0x9b, 0x14c);
            this.label8.Name = "label8";
            this.label8.Size = new Size(0x63, 0x13);
            this.label8.TabIndex = 2;
            this.label8.Text = "Hoạt chất:";
            this.label8.TextAlign = ContentAlignment.TopRight;
            this.txthoatchat.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.txthoatchat.Location = new Point(0xfe, 0x14b);
            this.txthoatchat.Name = "txthoatchat";
            this.txthoatchat.Size = new Size(0xcf, 20);
            this.txthoatchat.TabIndex = 4;
            this.txthoatchat.EditValueChanged += new EventHandler(this.txthoatchat_EditValueChanged);
            this.txthoatchat.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.label9.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.label9.Font = new Font("Tahoma", 10f);
            this.label9.Location = new Point(0x12d, 0x167);
            this.label9.Name = "label9";
            this.label9.Size = new Size(0x4c, 0x13);
            this.label9.TabIndex = 2;
            this.label9.Text = "Nh\x00f3m:";
            this.label9.TextAlign = ContentAlignment.TopRight;
            this.cbbnhom.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom;
            this.cbbnhom.EditValue = 0;
            this.cbbnhom.Location = new Point(0x177, 0x165);
            this.cbbnhom.Name = "cbbnhom";
            this.cbbnhom.Properties.Appearance.Font = new Font("Tahoma", 10f);
            this.cbbnhom.Properties.Appearance.Options.UseFont = true;
            this.cbbnhom.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.cbbnhom.Properties.Columns.AddRange(new LookUpColumnInfo[] { new LookUpColumnInfo("id", "id", 20, FormatType.None, "", false, HorzAlignment.Default), new LookUpColumnInfo("ten", "T\x00ean") });
            this.cbbnhom.Properties.DropDownRows = 10;
            this.cbbnhom.Properties.HeaderClickMode = HeaderClickMode.AutoSearch;
            this.cbbnhom.Properties.HideSelection = false;
            this.cbbnhom.Properties.HighlightedItemStyle = HighlightStyle.Standard;
            this.cbbnhom.Properties.NullText = "";
            this.cbbnhom.Size = new Size(320, 0x16);
            this.cbbnhom.TabIndex = 6;
            this.cbbnhom.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.label10.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.label10.Font = new Font("Tahoma", 10f);
            this.label10.Location = new Point(8, 0x167);
            this.label10.Name = "label10";
            this.label10.Size = new Size(0x4c, 0x13);
            this.label10.TabIndex = 2;
            this.label10.Text = "Loại:";
            this.label10.TextAlign = ContentAlignment.TopRight;
            this.cbbloai.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.cbbloai.EditValue = 0;
            this.cbbloai.Location = new Point(0x51, 0x165);
            this.cbbloai.Name = "cbbloai";
            this.cbbloai.Properties.Appearance.Font = new Font("Tahoma", 10f);
            this.cbbloai.Properties.Appearance.Options.UseFont = true;
            this.cbbloai.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.cbbloai.Properties.Columns.AddRange(new LookUpColumnInfo[] { new LookUpColumnInfo("id", "id", 20, FormatType.None, "", false, HorzAlignment.Default), new LookUpColumnInfo("ten", "T\x00ean") });
            this.cbbloai.Properties.DropDownRows = 10;
            this.cbbloai.Properties.HeaderClickMode = HeaderClickMode.AutoSearch;
            this.cbbloai.Properties.HideSelection = false;
            this.cbbloai.Properties.HighlightedItemStyle = HighlightStyle.Standard;
            this.cbbloai.Properties.NullText = "";
            this.cbbloai.Size = new Size(0xe1, 0x16);
            this.cbbloai.TabIndex = 5;
            this.cbbloai.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.label11.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.label11.Font = new Font("Tahoma", 10f);
            this.label11.Location = new Point(0x2ae, 360);
            this.label11.Name = "label11";
            this.label11.Size = new Size(0x4a, 0x13);
            this.label11.TabIndex = 2;
            this.label11.Text = "Nh\x00e0 SX:";
            this.label11.TextAlign = ContentAlignment.TopRight;
            this.cbbnhasx.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.cbbnhasx.EditValue = 0;
            this.cbbnhasx.Location = new Point(0x2f7, 0x165);
            this.cbbnhasx.Name = "cbbnhasx";
            this.cbbnhasx.Properties.Appearance.Font = new Font("Tahoma", 10f);
            this.cbbnhasx.Properties.Appearance.Options.UseFont = true;
            this.cbbnhasx.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.cbbnhasx.Properties.Columns.AddRange(new LookUpColumnInfo[] { new LookUpColumnInfo("id", "id", 20, FormatType.None, "", false, HorzAlignment.Default), new LookUpColumnInfo("ten", "T\x00ean") });
            this.cbbnhasx.Properties.DropDownRows = 10;
            this.cbbnhasx.Properties.HeaderClickMode = HeaderClickMode.AutoSearch;
            this.cbbnhasx.Properties.HideSelection = false;
            this.cbbnhasx.Properties.HighlightedItemStyle = HighlightStyle.Standard;
            this.cbbnhasx.Properties.NullText = "";
            this.cbbnhasx.Size = new Size(0x95, 0x16);
            this.cbbnhasx.TabIndex = 6;
            this.cbbnhasx.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            base.AutoScaleDimensions = new SizeF(6f, 13f);
//            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.txtstt);
            base.Controls.Add(this.txtma);
            base.Controls.Add(this.gridds);
            base.Controls.Add(this.btnketthuc);
            base.Controls.Add(this.btnimport);
            base.Controls.Add(this.btnin);
            base.Controls.Add(this.btnxoa);
            base.Controls.Add(this.btnboqua);
            base.Controls.Add(this.btnsua);
            base.Controls.Add(this.btnluu);
            base.Controls.Add(this.btnmoi);
            base.Controls.Add(this.txtten);
            base.Controls.Add(this.label3);
            base.Controls.Add(this.txthoatchat);
            base.Controls.Add(this.txthamluong);
            base.Controls.Add(this.label8);
            base.Controls.Add(this.label6);
            base.Controls.Add(this.txtdvt);
            base.Controls.Add(this.label4);
            base.Controls.Add(this.txtghichu);
            base.Controls.Add(this.label7);
            base.Controls.Add(this.label5);
            base.Controls.Add(this.label2);
            base.Controls.Add(this.label1);
            base.Controls.Add(this.cbbnhom);
            base.Controls.Add(this.cbbloai);
            base.Controls.Add(this.cbbnhasx);
            base.Controls.Add(this.label10);
            base.Controls.Add(this.label9);
            base.Controls.Add(this.label11);
            base.Name = "ucd_dmduocpham";
            base.Size = new Size(0x392, 0x19f);
            base.Load += new EventHandler(this.ucDMSanPham_Load);
            base.KeyDown += new KeyEventHandler(this.ucDMSanPham_KeyDown);
            this.txtma.Properties.EndInit();
            this.txtten.Properties.EndInit();
            this.txtdvt.Properties.EndInit();
            this.txtstt.Properties.EndInit();
            this.txtghichu.Properties.EndInit();
            this.gridView1.EndInit();
            this.repositoryItemTextEdit1.EndInit();
            this.gridds.EndInit();
            this.txthamluong.Properties.EndInit();
            this.txthoatchat.Properties.EndInit();
            this.cbbnhom.Properties.EndInit();
            this.cbbloai.Properties.EndInit();
            this.cbbnhasx.Properties.EndInit();
            base.ResumeLayout(false);
        }

        private void txthoatchat_EditValueChanged(object sender, EventArgs e)
        {
        }

        private void txtten_Validated(object sender, EventArgs e)
        {
            try
            {
                this.txtten.Text = this.txtten.Text.Substring(0, 1).ToUpper() + this.txtten.Text.Substring(1);
            }
            catch
            {
            }
        }

        private void ucDMSanPham_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                SendKeys.Send("{Tab}");
            }
            else if (e.KeyCode == Keys.F2)
            {
                if (this.btnmoi.Enabled)
                {
                    this.btnmoi_Click(null, null);
                }
            }
            else if (e.KeyCode == Keys.F3)
            {
                if (this.btnsua.Enabled)
                {
                    this.btnsua_Click(null, null);
                }
            }
            else if (e.KeyCode == Keys.F4)
            {
                if (this.btnboqua.Enabled)
                {
                    this.btnboqua_Click(null, null);
                }
            }
            else if (e.KeyCode == Keys.F5)
            {
                if (this.btnluu.Enabled)
                {
                    this.btnluu_Click(null, null);
                }
            }
            else if (e.KeyCode == Keys.F7)
            {
                if (this.btnxoa.Enabled)
                {
                    this.btnxoa_Click(null, null);
                }
            }
            else if ((e.KeyCode == Keys.F12) && this.btnketthuc.Enabled)
            {
                this.btnketthuc_Click(null, null);
            }
        }

        private void ucDMSanPham_Load(object sender, EventArgs e)
        {
            this._dto = new dtoDDMDuocPham(this._condata);
            this._xuli = new General(this._condata);
            this.f_Loaddata_dmvp();
            this.f_Loaddata_dmloaidp();
            this.f_Loaddata_dmnhomdp();
            this.f_Loaddata_dmnhasx();
            this.btnboqua_Click(null, null);
            this.f_loadinfo_dmsanpham(0);
        }
    }
}

